<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Memcache
 *
 * @author ananda
 */
class Data_Record_Pdo extends Data_Record
{
    protected $data;

    public $fetch_mode = PDO::FETCH_ASSOC;

    public function init()
    {
        $this->data = $this->handler->fetch($this->fetch_mode);
    }

    public function getData()
    {
        return $this->data;
    }

    /**
     * 数组存取接口
     * @param string $offset
     * @return boolean
     */
    public function offsetExists($offset)
    {
        return isset($this->data[$offset]);
    }

    /**
     * 数组存取接口
     * @param string $offset
     * @return mixed
     */
    public function offsetGet($offset)
    {
        return $this->data[$offset];
    }

    /**
     * 数组存取接口
     * @param string $offset
     * @param mixed $value
     * @return void
     */
    public function offsetSet($offset, $value)
    {
        $this->data[$offset] = $value;
    }

    /**
     * 数组存取接口
     * @param string $offset
     * @return void
     */
    public function offsetUnset($offset)
    {
        unset($this->data[$offset]);
    }

}
?>